package org.htmlparser.tags;

import org.htmlparser.lexer.Page;
import org.htmlparser.nodes.TagNode;
import org.htmlparser.util.ParserException;

public class BaseHrefTag extends TagNode
{
  private static final String[] mIds;

  static
  {
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "BASE";
    mIds = arrayOfString;
  }

  public void doSemanticAction()
    throws ParserException
  {
    Page localPage = getPage();
    if (localPage != null)
      localPage.setBaseUrl(getBaseUrl());
  }

  public String getBaseUrl()
  {
    String str = getAttribute("HREF");
    if ((str != null) && (str.length() > 0))
      str = str.trim();
    if (str == null)
      str = "";
    return str;
  }

  public String[] getIds()
  {
    return mIds;
  }

  public void setBaseUrl(String paramString)
  {
    setAttribute("HREF", paramString);
  }
}